package com.ruoyi.system.controller;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.system.domain.bo.SysUserMessageBo;
import com.ruoyi.system.service.ISysUserMessageService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 内部接口控制器
 * 前端访问路由地址为:/inner
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/inner")
public class InnerController extends BaseController {

    private final ISysUserMessageService iSysUserMessageService;

    /**
     * 新增用户消息通知
     */
    @PostMapping("/notice")
    public R<Void> add(@Validated(AddGroup.class) @RequestBody SysUserMessageBo bo, @RequestHeader String secret) {
        return toAjax(iSysUserMessageService.addNotice(bo, secret));
    }
}
